function main(layero, notice) {
    debugger;
    //无需再执行layui.use()方法加载模块，直接使用即可
    var form = layui.form,
        layer = layui.layer,
        laytpl = layui.laytpl;

    form.render();
    //设置焦点
    // $(layero).find('.layui-input')[0].focus();
    var template = Handlebars.compile($("#result-template").html());
    // var getTpl = $("#result-template").html();
    // var template = laytpl(getTpl).render;

    var substringMatcher = function (objs) {
        return function findMatches(q, cb) {
            var matches, substringRegex;

            // an array that will be populated with substring matches
            matches = [];

            // regex used to determine if a string contains the substring `q`
            substrRegex = new RegExp(q, 'i');

            // iterate through the pool of strings and for any string that
            // contains the substring `q`, add it to the `matches` array
            $.each(objs, function (i, obj) {
                if (substrRegex.test(obj['title']) || substrRegex.test(obj['code'])) {
                    matches.push(obj);
                }
            });

            cb(matches);
        };
    };

    
    $('.layui-input').typeahead({
        hint: false,
        highlight: true,
        minLength: 1,
    }, {
        limit: 100,
        name: 'notice',
        source: substringMatcher(notice),
        // source: engineWithDefaults,
        displayKey: 'title',
        templates: {
            suggestion: template,
            // suggestion:  laytpl(getTpl).render,
        }
    });

    $('.layui-input').bind('typeahead:select', function (ev, suggestion) {
        console.log(suggestion);
        var url='http://ew.ccs.org.cn/ccsewwms2007/displayViewCommonInfo.do?id=';
        // GM_openInTab(url+suggestion['note_id']);
        window.open(url+suggestion['note_id'], '_blank');
    });


};